﻿<script type="text/javascript">
    $(function () {
        $("input#searchbar").autocomplete({
            url: '@Url.Action("GetUserNames", "ADUser")',
            minChars: 4,
            delay: 1200
        });
    });

    $(document).ready(function () {

        var text = "Geef usernaam...";

        $("#searchbar").focus(function () {
            $(this).addClass("active");
            if ($(this).attr("value") == text) $(this).attr("value", "");
        });

        $("#searchbar").blur(function () {
            $(this).removeClass("active");
            if ($(this).attr("value") == "") $(this).attr("value", text);
        });
    });
    
</script>

<ul id="sddm">

@if ((bool)Session["isAdmin"])
{
  <li><a href="#" 
        onmouseover="mopen('m2')" 
        onmouseout="mclosetime()">Admin</a>
        <div id="m2" 
            onmouseover="mcancelclosetime()" 
            onmouseout="mclosetime()">
            <a href="@Url.Action("Index", "Log")">Log Lezen</a>
            <a href="@Url.Action("Index", "Enquete")">Enquetes</a>
            <a href="@Url.Action("makeEnviromentChangeLog", "Log")">Omgeving wijziging doorvoeren</a>
        </div>
    </li>
}
        
@if ((bool)Session["isHelpdesk"] || (bool)Session["isAdmin"])
{

    <li><a href="#" 
        onmouseover="mopen('m1')" 
        onmouseout="mclosetime()">Service Desk</a>
        <div id="m1" 
            onmouseover="mcancelclosetime()" 
            onmouseout="mclosetime()">
        
        @{
            @*Pas ook _ZoekUserForm.cshtml aan wanneer je deze aan past!*@
    using (Html.BeginForm("ZoekADUser", "ADUser"))
    {
        @Html.TextBox("searchbar", "Geef usernaam...", new { @autocomplete = "off" }) <button id="searchbtn" type="submit" > Zoek user... </button> 
    }
}
        <a href="@Url.Action("ZoekADUser", "ADUser")">Uitgebreid zoeken</a>
        </div>
    </li>

    
}

@if (!(bool)Session["isGuest"])
{
  <li class="current"><a href="@Url.Action("Index", "Home")">Home</a></li>
}

</ul>
<div style="clear:both"></div>